<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">
<h:head>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
</h:head>

<ui:param name="bean" value="#{itemConsumeDetailReasonConfigAction}" />
<h:body>
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="true" />
		
		<p:panel id="panel1" header="添加" style="margin-bottom:10px;">
			<p:dataTable id="dlist" var="l" value="#{bean.entity}" resizableColumns="true" paginator="false" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
				<p:column headerText="消耗细分标识" styleClass="column">
					<h:inputText value="#{l.reasonid}" />
				</p:column>
				<p:column headerText="消耗细分原因" styleClass="column">
					<h:inputText value="#{l.reasonname}" />
				</p:column>
				<p:column headerText="操作" styleClass="column">
					<p:commandButton value="添加" action="#{bean.add()}" update=":data" ajax="false" />
				</p:column>
			</p:dataTable>
   		</p:panel>
	</h:form>
	<br />

	<h:form id="dform">
		<div class="data" id="data">
			<p:panel id="panel1" header="结果展示" style="margin-bottom:10px;">
				<p:dataTable id="dlist" var="l" value="#{bean.list}" resizableColumns="true" paginator="true" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
					<p:column headerText="消耗细分标识" styleClass="column">
						<h:outputText value="#{l.reasonid}" />
					</p:column>
					<p:column headerText="消耗细分原因" styleClass="column">
						<h:inputText value="#{l.reasonname}" />
					</p:column>
					<p:column headerText="操作" styleClass="column">
					<p:commandButton value="修改" action="#{bean.modify(l)}" update=":data" ajax="false" />
						<p:commandButton value="删除" action="#{bean.delete(l.id)}" update=":data" ajax="false" />
					</p:column>
				</p:dataTable>
	   		</p:panel>
   		</div>
	</h:form>
</h:body>
</html>
